<?php

namespace App\Console;

use App\Jobs\Remind\AttendanceRemind;
use App\Jobs\Remind\InspectionRemind;
use App\Jobs\Push\AttendanceRemindPush;
use App\Jobs\Remind\StationReportRemind;
use Illuminate\Console\Scheduling\Schedule;
use App\Jobs\Finance\MonthlySalaryGenerator;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
		/**
		 * 每天23:00点获取次日排班记录
		 */
    	$schedule->job(new AttendanceRemind)->dailyAt('23:00');
    	// 每分钟触发一次通知推送
    	$schedule->job(new AttendanceRemindPush)->everyMinute();

    	// 每天触发巡检提醒
    	$schedule->job(new InspectionRemind)->dailyAt('23:00');
    	// 每天触发报岗提醒
    	$schedule->job(new StationReportRemind)->dailyAt('23:00');

		/**
		 * 薪资报表生成
		 */
    	$schedule->job(new MonthlySalaryGenerator)->monthlyOn(1, '23:00');
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}
